package com.qiangqiang.task.server.mapper;

import com.qiangqiang.task.server.entity.Comments;
import com.qiangqiang.task.server.entity.Follow;
import com.qiangqiang.task.server.mapper.provider.CommentsProvider;
import com.qiangqiang.task.server.mapper.provider.FollowProvider;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface FollowMapper {

    @InsertProvider(type = FollowProvider.class, method = "insertFollow")
    int insertFollow(@Param("follow") Follow follow);

    @Select("select * from follow where user_id=#{userId} and followed_user_id=#{followerId}")
    Follow isFollowed(@Param("userId") long userId, @Param("followerId") long followerId);

    // TODO List 最好改为 Set
    @SelectProvider(type = FollowProvider.class,method = "queryFollowsOrFans")
    List<Follow> queryFollowsOrFans(@Param("userId") long userId,@Param("isFindFans") boolean isFindFans);
}
